﻿using System;
using UnityEngine;

namespace CornerMemo
{
    /// <summary>
    /// 所有UI窗体的基类
    /// </summary>
    public abstract class UIForm : MonoBehaviour
    {
        [NonSerialized]
        public int Order = 0;

        public virtual void OnInit() { }

        public virtual void OnOpen(object userData = null)
        {
            gameObject.SetActive(true);
        }

        public virtual void OnClose() { }

        public virtual void Close()
        {
            gameObject.SetActive(false);
            OnClose();
        }
    }
}